# 例4-1按索引或标签排序
import numpy as np
import pandas as pd
arr = np.random.randint(1,20,size=(3,3))
df = pd.DataFrame(arr,columns=['c','b','a'])
print('原始数据:\n',df.sort_index(ascending=False))
print('按列标签升序排序:\n',df.sort_index(axis=1))
